#include "rclcpp/rclcpp.hpp"


class Param_node : public rclcpp::Node
{
  private:
	rclcpp::TimerBase::SharedPtr timer;
	int param_int_a;
	double param_double_a;
	std::string param_string_a;
	void timer_callback(void)
	{
		RCLCPP_INFO(this->get_logger(), "------");
		this->get_parameter("param_int_a", param_int_a);
		RCLCPP_INFO(this->get_logger(), "param_int_a: %d", param_int_a);
		this->get_parameter("param_double_a", param_double_a);
		RCLCPP_INFO(this->get_logger(), "param_double_a: %f", param_double_a);
		this->get_parameter("param_string_a", param_string_a);
		RCLCPP_INFO(this->get_logger(), "param_string_a: %s", param_string_a.c_str());
	}

  public:
	Param_node(std::string name) : Node(name)
	{

		this->declare_parameter("param_int_a", 0);
		this->declare_parameter("param_double_a", 0.0);
		this->declare_parameter("param_string_a", "what");
		timer = this->create_wall_timer(std::chrono::milliseconds(500),
											 std::bind(&Param_node::timer_callback, this));
	}
};

int main(int argc, char **argv)
{
	rclcpp::init(argc, argv);
	auto node = std::make_shared<Param_node>("param_node");
	rclcpp::spin(node);
	rclcpp::shutdown();
	return 0;
}



